/**
 * @className: ShiftController
 * @author: Csh
 * @date: 2024/4/8 14:18
 * @Version: 1.0
 * @description:
 */
package com.zhuojy.equity.mall.admin.web.controller.AttendanceControllers;

import com.zhuojy.equity.mall.admin.common.entity.bo.ShiftBO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.AttendanceServices.ShiftService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RequestMapping("shift")
@RestController
@Api(tags = "班次管理")
public class ShiftController {

    @Autowired
    private ShiftService shiftService;

    /***
        * @Author Csh
        * @Description 分页条查班次信息
        * @Date 16:38 2024/4/8
        * @Param [shiftBO, pageSize, pageNum]
        * @return com.zhuojy.equity.mall.admin.common.pojo.ResultEntity
    **/
    @RequestMapping("findAll")
    ResultEntity findAll(@RequestBody ShiftBO shiftBO, @RequestParam(value = "pageSize",defaultValue = "100")Integer pageSize, @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum){
        return shiftService.findAll(shiftBO,pageNum,pageSize);
    }
    /***
        * @Author Csh
        * @Description 新增/修改班次信息
        * @Date 19:27 2024/4/8
        * @Param [shiftBO]
        * @return int
    **/
    @RequestMapping("addOrUpShift")
    int addOrUpShift(@RequestBody ShiftBO shiftBO){
        return shiftService.addOrUpShift(shiftBO);
    }

    @RequestMapping("findOneShiftBO")
    ShiftBO findOneShiftBO(@RequestParam(value = "id")String id){
        return shiftService.findOneShiftBO(id);
    }

}
